import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCmsFormsController } from '../../../controllers';
const uctoocmsFormsRouter = new Router();
const cmsFormsController = new uctooCmsFormsController();

uctoocmsFormsRouter.post('/add', requireUser, cmsFormsController.add);
uctoocmsFormsRouter.post('/edit', requireUser, rowLevelPermission('uctoo/cms_forms'), cmsFormsController.edit);
uctoocmsFormsRouter.post('/del', requireUser, rowLevelPermission('uctoo/cms_forms'), cmsFormsController.delete);

//For getting cmsForms with permission control
uctoocmsFormsRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/cms_forms'), cmsFormsController.getSingle);
uctoocmsFormsRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/cms_forms'), cmsFormsController.getMany);
uctoocmsFormsRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/cms_forms'), cmsFormsController.getMany);

//#endregion AutoCreateCode
export default uctoocmsFormsRouter;
